#include "graph.h"

int main(int argc,char *argv[])
{
  Graph mygraph;

  read_graph(&mygraph,argv[1]);

  /* you take it from here */
 Node maxOut = mygraph.table[1],
      maxIn = mygraph.table[1],
      minOut = mygraph.table[1],
      minIn = mygraph.table[1];

 for(int i = 0; i<mygraph.MaxSize; i++){
	 if(mygraph.table[i].outdegree>maxOut.outdegree){
		 maxOut = mygraph.table[i];
	 }
	 if(mygraph.table[i].outdegree<minOut.outdegree&&
	    mygraph.table[i].outdegree != 0){
		 minOut = mygraph.table[i];
	 }

	 if(mygraph.table[i].indegree>maxIn.indegree){
		 maxIn = mygraph.table[i];
	 }
	 if(mygraph.table[i].indegree<minIn.indegree&&
		mygraph.table[i].indegree != 0){
	     minIn = mygraph.table[i];
	 }

 }
 printf("the node [%s] with maximum out-degree: %d\n",maxOut.name, maxOut.outdegree);
 printf("the node [%s] with minimum out-degree: %d\n",minOut.name, minOut.outdegree);
 printf("the node [%s] with maximum in-degree: %d\n",maxIn.name, maxIn.indegree);
 printf("the node [%s] with minimum in-degree: %d\n",minIn.name, minIn.indegree);

  return(0);
}
